import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:simple_pwd_node/components/my_dialog.dart';
import 'package:simple_pwd_node/components/pwd_set_dialog.dart';

class SettingPage extends StatefulWidget {
  const SettingPage({Key key}) : super(key: key);

  @override
  _SettingPageState createState() => _SettingPageState();
}

class _SettingPageState extends State<SettingPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('设置哦'),
      ),
      body: Container(
        child: ListView(
          children: [
            ListTile(
              leading: new Icon(Icons.lock),
              title: Text('设置进入密码'),
              trailing: new Icon(Icons.post_add),
              onTap: () {
                // showDialog(context: context,builder: (context) => MyDialog("title","content"),);
                _modalBottomSheet();
              },
            )
          ],
        ),
      ),
    );
  }

  _modalBottomSheet() async {
    showModalBottomSheet(
        context: context,
        isScrollControlled: true,
        builder: (context) {
          return new PwdSetDialog();
        });
  }
}
